package com.example.gslih.myapplication.toast;

import android.content.Context;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Message;
import android.text.SpannableString;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;


public class TtToastUtil {

	/**
	 * 自定义显示toast时间
	 * @param context
	 * @param msg
	 * @param time
	 */
	public static void showToastSetTime(final Context context, final String msg, final long time) {
		final Toast toast = Toast.makeText(context, msg, Toast.LENGTH_LONG);
		toast.show();
		new CountDownTimer(time,time) {
			@Override
			public void onTick(long l) {

			}

			@Override
			public void onFinish() {
				toast.cancel();
			}
		}.start();
	}
}
